<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - IntegerField Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!--[if IE 6]>
<link type='text/css' rel='stylesheet' href='../css/inputEx-IE6.css' />
<![endif]-->

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<p class='demoTitle'>inputEx - IntegerField Usage</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Basic IntegerField creation</p>
	
	<p>Use the following code to create a basic inputEx IntegerField.</p>

	<div class='demoContainer' id='container1'></div>
	<div id='valueContainer1'></div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			new YAHOO.inputEx.IntegerField({parentEl: 'container1', showMsg: true});
		</textarea>
			</div>

</div>


<!-- Example 2 -->
<div class='exampleDiv'>
	<p class="title">IntegerField with options</p>
	<p>Test IntegerField with more options.</p>
	<div class='demoContainer' id='container2'></div>
	<div id='valueContainer2'></div>

	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new YAHOO.inputEx.IntegerField({parentEl: 'container2', showMsg: true, required:true, typeInvite:"Enter a number"});
		</textarea>
	</div>
</div>


<!-- Example 3 -->
<div class='exampleDiv'>
	<p class="title">Negative values</p>
	<p>Set the negative attribute to true if you allow negative values.</p>
	<div class='demoContainer' id='container3'></div>
	<div class='codeContainer'>
		<textarea name="code" class="JScript">
			new YAHOO.inputEx.IntegerField({parentEl: 'container3', showMsg: true, required:true, negative:true});
		</textarea>
	</div>
</div>


<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/container/container-min.js"></script>


<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/fields/StringField.js"  type='text/javascript'></script>
<script src="../js/fields/IntegerField.js"  type='text/javascript'></script>

<script>

YAHOO.util.Event.addListener(window, 'load', function() {

	// Example 1
	var field = new YAHOO.inputEx.IntegerField({parentEl: 'container1', showMsg: true});
	field.updatedEvt.subscribe(function(e, params) {
		YAHOO.util.Dom.get('valueContainer1').innerHTML = "value: "+params[0]+", type: "+typeof(params[0]);
	});
	
	
	// Example 2
	var field = new YAHOO.inputEx.IntegerField({parentEl: 'container2', showMsg: true, required:true, typeInvite:"Enter a number"});
	field.updatedEvt.subscribe(function(e, params) {
		YAHOO.util.Dom.get('valueContainer2').innerHTML = "value: "+params[0]+", type: "+typeof(params[0]);
	});
	
	// Example 3
  new YAHOO.inputEx.IntegerField({parentEl: 'container3', showMsg: true, required:true, negative:true});
	
});

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>